import os


class matrix:
    """
    the big matrix representing the whole graph
    which can not be load into RAM at once.
    should be decomposed into blocks
    """
    def __init__(self, data_path, dim, block_dim):
        """

        :param data_path: path to the matrix's data.
                          it would be reasonable for the big_data_matrix to have a path representing it's
                          data on disk, such that for each block can have a file which could be load to
                          disk at once belonging to such path. In this way it would be niiiiice to organize
                          the data

        :param dim: dimension of the large matrix

        :param block_dim: dimension of the mutable small matrix (which may be referred to as blocks).
                          you may assume that: dim % block == 0, however it should be also correct when
                          the equation is false
        """
        super(matrix, self).__init__()
        self.data_path = data_path
        self.dim = dim
        self.block_dim = block_dim
        if not os.path.exists(data_path):
            os.mkdir(data_path)
        # TODO

    def show(self, small_i, small_j):
        """

        :param small_i:
        :param small_j:
        :return:
        """
        # TODO
        ...

    def read_block(self, block_i, block_j):
        """
        read the (block_i, block_j) small matrix
        :param block_i:
        :param block_j:
        :return:
        """
        # TODO
        ...

    def _add_pos(self, i, j):
        """
        this means to add a edge from i to j in the large matrix
        :param i:
        :param j:
        :return:
        """
        # TODO
        ...

    def read_pos(self, i, j):
        """
        read the exact (i,j) position in the large matrix.
        implement this only when needed
        :param i:
        :param j:
        :return:
        """
        # TODO
        ...
